package com.googlecode.gaal.suffix.api;

import java.util.Iterator;

import com.googlecode.gaal.data.api.IntSequence;
import com.googlecode.gaal.suffix.api.IntervalTree.Interval;

public interface IntervalTree<T extends Interval> {

    public T top();

    public Iterator<T> preorderIterator();

    public interface Interval {

        public int left();

        public int right();

        public int lcp();

        public int size();

        /**
         * obtain a sequence from the suffixTable table corresponding to this
         * interval
         * 
         * @return IntSequence from the suffixTable containing this interval
         */
        public IntSequence indices();

        public IntSequence label();

        public IntSequence edgeLabel(Interval parent);

        public boolean isTerminal();

    }
}
